<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Open Switch</title>
    <style>
        body {
            width: 35em;
            margin: 0 auto;
            font-family: Tahoma, Verdana, Arial, sans-serif;
        }
        #errormessage{
            color:#ff0000;
        }
    </style>
    <script type="text/javascript" src="../js/node_modules/jquery/dist/jquery.min.js"></script>
    <script type="text/javascript" src="../js/defs/login.js"></script>
</head>
<body>
    <h1 align="center">Open Switch</h1>
  	<div id="loginBox" class="container">
  		<form action="" id="loginForm">
  		<p align="center"><label>姓名：<input type="text" name="username" placeholder="admin" autofocus="autofocus"></label></p>
  		<p align="center"><label>密码：<input type="password" name="password" placeholder="000" required="required"></label></p>
        <p align="center"><label id="errormessage"></label></p>
  		<p align="center">
            <input type="button" id="loginbtn" name="loginbtn" value="登录">
  	 	</p>
  		</form>
  	</div>
    <!--
    <div class="name">
        <label>用户名:</label>
        <input type="text" name="username" id="username">
    </div>
    <div class="password">
        <label>密码:</label>
        <input type="password" name="password" id="password" >
    </div>
    <div id="errormessage"></div>
    <button type="button" id="denglubutton">登陆</button>
    <script type="text/javascript">
        $("#denglubutton").click(function(){
            $.post("login.json",
                //发送给后端的数据
                {
                    "name":$("#username").val(),
                    "password":$("#password").val()
                },
                //回调函数
                function(data){
                    var json=data[0];
                    if(json.success == 0){
                        $("#errormessage").text("用户名或密码错误");
                    }
                    else if(json.success== 1){
                        window.location.href="swhome.html";
                    }
                }
            )
        })
    </script>
    -->
    
</body>
</html>
